<?php
/**
 * ClassName: payment_log
 * Description: 线下支付记录
 * @Author 周昌
 * @Create 2023/11/17 9:13
 */

namespace app;


use epii\server\Args;
use HPlus\Validate\Validate;
use libs\Tool;
use model\CardModel;
use model\MemberModel;
use service\admin\CardCateService;
use service\admin\CardPreferentialService;
use service\admin\CardLogService;
use service\admin\HospitalService;

class payment_log extends base
{
    public function init()
    {
        parent::init();
        $this->accessDenied();
    }
    public function index()
    {
        if($this->adminInfo['role']==1){
            $this->assign('hospitals',HospitalService::getSelect());
        }
        //筛选
        $this->_as_type=CardLogService::cardLogTypeSelect();
        $this->adminUiDisplay();
    }

    public function ajax_data()
    {
        $map = [];
        //登录用户权限判断
        $hospital_id=$this->adminInfo['hospital_id'];
        if($hospital_id){
            $map[]=['hospital_id','=',$hospital_id];
        }
        $type=Args::params('type/d');
        if(is_int($type)){
            $map[]=['type','=',$type];
        }
        echo CardLogService::getAjaxData($map);
    }
    

}